Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add softness for Threshold anti-aliasing #2812

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

RunDevelopment
Copy link
Member

While using chainner's Threshold node to sharpen some upscaled text, I noticed that the AA is quite sharp. This is generally good, but I would have liked a bit softer in this case. So I added a high-quality sub-pixel blur to binary_threshold by exploiting how it calculates anti-aliased pixel. See chaiNNer-org/chaiNNer-rs#27 for details.

This PR adds this new functionality in chainner_ext to the Threshold node via the new Softness slider. Users can set the softness as a value between 0 and 10.

I limited the slider to 11 values, because the blur is very subtle. A softness of 10 is roughly equivalent to a box blur of radius 0.3, and 5 roughly corresponds to 0.15. So having many in-between values wouldn't be useful.

image

@joeyballentine joeyballentine merged commit 655216a into chaiNNer-org:main Apr 23, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the threshold-softness branch April 23, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants